<template>
  <section>
    <BaseSlot ref="view" :globalLoading="globalLoading">
      <template slot="table">
        <el-row>
          <PurchaseElectric :data="metaData" />
        </el-row>
        <el-row class="mr_vertical_10">
          <BasicInfors :data="metaData" />
        </el-row>
        <el-row type="flex" justify="space-between" :gutter="20">
          <el-col :span="8">
            <OtherSideInfors :data="metaData" />
          </el-col>
          <el-col :span="16">
            <QuoteInfors :data="metaData" />
          </el-col>
        </el-row>
      </template>
      <!-- <template slot="popup-title">
        <h2>{{ popupTitle }}</h2>
      </template>
      <template slot="popup-body">
        <component
          ref="coreCpt"
          :is="coreCpt"
          :popupTitle="popupTitle"
          :coreData="coreData"
          :isView="isView"
          :isEdit="isEdit"
          @submit="submitTask"
          @close="closeCpt"
        />

      </template>-->
    </BaseSlot>
  </section>
</template>
<script lang='ts'>
import { Vue, Component, Watch } from "vue-property-decorator";
import BaseSlot from "@/components/BaseSlot.vue";
import PurchaseElectric from "./common/purchaseElectric.vue";
import BasicInfors from "./common/basicInfors.vue";
import OtherSideInfors from "./common/otherSideInfors.vue";
import QuoteInfors from "./common/quoteInfors.vue";

@Component({
  components: {
    BaseSlot,
    PurchaseElectric,
    BasicInfors,
    OtherSideInfors,
    QuoteInfors
  }
})
export default class MyApplication extends Vue {
  protected orderNo: any = "";
  protected metaData: any = {
    // amount: 1000,
    // price: 100,
    // quantity: 10,
    // a: 0
  };
  protected created() {
    this.$nextTick(() => {
      this.metaData = {
        amount: 1000,
        price: 100,
        quantity: 10,
        order_no: "x-aslkdf8y",
        status: "done",
        type: "p2p",
        txid: "asldjfaasdfuwr",
        created_at: 1602426171,
        offerer_did: "123",
        saler_did: "123",
        saler_credit: "123",
        buyer_did: "456",
        buyer_credit: "456",
        offer_no: 'baojiadanno',
        offer_type: "自由交易",
        offer_tpno: '20201203'

      };
    });
    this.init();
  }
  protected init() {
    this.$api.getOrdersGet({ order_no: this.$route.query.order_no }).then((res: any) => {
      this.$nextTick(() => {
        this.metaData = res.data;
      });
    });
  }
}
</script>

<style lang="scss" scoped>
.mr_vertical_10 {
  margin: 10px 0;
}
.mr_w_10 {
  margin: 0 10px;
}
.margin-right {
  margin-right: 30px;
}
</style>


